<ion-view>
  <ion-nav-title>
    {{theSession | chatName}}
  </ion-nav-title>
  <ion-nav-buttons side="right">
    <button class="button button-icon ion-navicon rotate90" menu-toggle="right"></button>
  </ion-nav-buttons>

  <ion-content class="stable-bg padding" delegate-handle="chatScroll">
    <ol class="msg-list">
      <li ng-repeat="msg in messages | orderBy: 'timestamp'" ng-class="{'my-msg':msg.user._id===$root.currentUser._id,'others-msg':msg.user._id!==$root.currentUser._id}">
        <div class="user-info">
          <div class="face">
            <i class="icon ion-person"></i>
          </div>
          <div class="name text-center">{{msg.user.name}}</div>
        </div>
        <div class="message">
          <div class="msg-content" ng-bind-html="msg.content"></div>
          <div class="timestamp dark2"><small>{{msg.timestamp | amTimeAgo}}</small></div>
        </div>
      </li>
    </ol>

  </ion-content>
  <ion-footer-bar keyboard-attach class="bar-light" id="notice">
      <div class="row row-bottom">
        <ion-scroll direction="y" id="msg" ng-show="isText">
          <div class="msg-to-send"
            ng-model="data.content"
            on-focus="inputUp()"
            on-blur="inputDown()" contenteditable="true"></div>
        </ion-scroll>
        <div class="speaker" id="speaker" ng-show="!isText">
          <button class="button button-outline button-block" ng-click="captureAudio()">按住说话</button>
        </div>
        <button class="button button-balanced" ng-disabled="data.content.length <= 0" ng-click="sendMessage()">发送</button>
      </div>
  </ion-footer-bar>
</ion-view>
